From 629601a5dc092b98529f228c83364f25fa099b9d Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 25 Jul 2004 11:49:05 +0000 Subject: [PATCH] don't redirect to the canonical title if other parameters have been passed in $_GET --- includes/WebRequest.php | 4 ++++ index.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/WebRequest.php b/includes/WebRequest.php index bcec3c05fc..303af7c6ab 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -117,6 +117,10 @@ class WebRequest { function getValues() { $names = func_get_args(); + if ( count( $names ) == 0 ) { + $names = array_keys( $_REQUEST ); + } + $retVal = array(); foreach ( $names as $name ) { $value = $this->getVal( $name ); diff --git a/index.php b/index.php index 85403d9d54..c01a2b12a8 100644 --- a/index.php +++ b/index.php @@ -74,7 +74,9 @@ if ( $search = $wgRequest->getText( 'search' ) ) { $wgTitle = Title::newFromText( wfMsg( "badtitle" ) ); $wgOut->errorpage( "badtitle", "badtitletext" ); } -} else if ( ( $action == "view" ) && $wgTitle->getPrefixedDBKey() != $title ) { +} else if ( ( $action == "view" ) && $wgTitle->getPrefixedDBKey() != $title && + !count( array_diff( array_keys( $_GET ), array( 'action', 'title' ) ) ) ) +{ /* redirect to canonical url, make it a 301 to allow caching */ $wgOut->redirect( $wgTitle->getFullURL(), '301'); } else if ( Namespace::getSpecial() == $wgTitle->getNamespace() ) { -- 2.20.1